package Last.p12;

/**
 * @author Lenovo
 */
public class Main {
   private static Runnable makeRunnable() {
       return () -> {
          for (int i = 0; i < 5; i++) {
             Thread t = Thread.currentThread();
             System.out.println("in run() - priority="
             + t.getPriority()+ ", name=" + t.getName());
             try {
                Thread.sleep(2000);
             }
             catch (InterruptedException ignored) {
             }
          }
       };
   }
   public static void main(String[] args) throws InterruptedException {
      System.out.println("in main() - Thread.currentThread().getPriority()=" + Thread.currentThread().getPriority());
      System.out.println("in main() - Thread.currentThread().getName()="+ Thread.currentThread().getName());
      Thread threadA = new Thread(makeRunnable(), "threadA");
      threadA.start();
       Thread.sleep(3000);
       System.out.println("in main() - threadA.getPriority()="+ threadA.getPriority());
   }
}